/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package itproject.clients.gui;

import java.awt.Component;
import java.awt.Component;
import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 *
 * @author tim
 */
public class FlightForm extends JPanel {
    EBInterface ebi;
    private JPanel bookingPanel;

    public FlightForm (EBInterface ebif){
        ebi = ebif;
        generateComponents();

    }

    private void generateComponents(){
        

        // Sets the border
        this.setBorder(BorderFactory.createCompoundBorder(
                BorderFactory.createTitledBorder("Easybooking Client "),
                BorderFactory.createEmptyBorder(20, 20, 20, 20)));
        
        this.setLayout(new GridBagLayout());
        GridBagLayout gbl = new GridBagLayout();

        JLabel lblServerHost = new JLabel("EasyBooking-Server:");
        addComponent(this, gbl, lblServerHost, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER, 0, 0, 1, 1, 0, 0);

    }

    private static void addComponent(Container cont, GridBagLayout gbl, Component c, int fill, int anchor, int x, int y, int width, int hight, double weightx, double weighty) {
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.fill = fill;
        gbc.anchor = anchor;
        gbc.gridx = x;
        gbc.gridy = y;
        gbc.gridwidth = width;
        gbc.gridheight = hight;
        gbc.weightx = weightx;
        gbc.weighty = weighty;
        gbc.insets = new Insets(10, 10, 10, 10);
        //gbl.setConstraints(c, gbc);
        cont.add(c, gbc);


    }



}
